<script>
import {defineComponent} from 'vue'
import 'bootstrap/dist/css/bootstrap.css'
import 'bootstrap/dist/js/bootstrap.js'
export default defineComponent({
    name: "myViem",
    data() {
        return {}
    },
    methods: {
        keyUp(e){
            console.log(e)
            if(e.keyCode ===116){
                //阻止键盘的按键起作用
                window.preventDefault();
            }

        },
        login(){
            window.location.href='https://www.baidu.com';
        }
    }
})
</script>

<template>
    <div>
        <input type="text" @keyup="keyUp">
        <input type="text" @keyup.65="keyUp">
        <input type="text" @keyup.f5="keyUp">
        <input type="text" @keyup.f2="keyUp">
        <input type="text" @keyup.space="login">
        <input type="text" @keyup.tab="login">
    </div>
</template>

<style scoped lang="less">

</style>